# Maintainer: Fabien Chouteau <chouteau@adacore.com>

_realname=libgpr
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=21.0.0
pkgrel=1

pkgdesc="Library for GPRbuild project files (mingw-w64)"
arch=('any')
license=('GPL3 with GCC exception')
url="https://github.com/AdaCore/gprbuild/"
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc-ada"
             "${MINGW_PACKAGE_PREFIX}-xmlada"
             "${MINGW_PACKAGE_PREFIX}-gprbuild")
depends=("${MINGW_PACKAGE_PREFIX}-xmlada")
source=("gprbuild-${pkgver}.tar.gz::https://github.com/AdaCore/gprbuild/archive/v${pkgver}.tar.gz")
sha256sums=('54b7d1a3298160109aaee4d8c263c1ab3ab4abae75d354f3e90a4c51639167a2')

build() {
  cd "${srcdir}/gprbuild-${pkgver}"

  make libgpr.build
}

package() {
  cd "${srcdir}/gprbuild-${pkgver}"

  make libgpr.install prefix="${pkgdir}${MINGW_PREFIX}"

  # Copy License Files
  install -Dm644 -t "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/" COPYING*
}
